package com.deli.mybatis.controller;

import com.deli.mybatis.entity.Employee;
import com.deli.mybatis.mapper.EmployeeMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xudeli
 * @Date: 2018/9/13/013 39
 * @Description: 员工的控制器
 */
@RestController
public class EmployeeController {

    private static final Logger logger = LoggerFactory.getLogger(Employee.class);
    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping("/select/{id}")
    public Employee selectById(@PathVariable("id") Integer id) {
        logger.info("into EmployeeController method : selectById");
        Employee emloyee = employeeMapper.getEmloyeeById(id);
        System.out.println(emloyee);
        return emloyee;
    }
}
